package com.poetize.plus.controller.ui;

import com.poetize.plus.entity.vo.NoticeVO;
import com.poetize.plus.service.NoticeService;
import com.poetize.plus.utils.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.security.PermitAll;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zuosy
 * @created 2024/5/11 16:18
 */
@Tag(name = "公告操作")
@RestController
@RequestMapping("/notice")
@RequiredArgsConstructor
public class NoticeUiController {

    private final NoticeService noticeService;

    @PermitAll
    @GetMapping("/getNoticeById/{id}")
    @Operation(summary = "获取公告详情")
    public R<NoticeVO> getNoticeById(@PathVariable("id") Long id){
        return R.ok(noticeService.queryNotice(id));
    }
}
